package vehicle_maintain_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 车辆维修-收费情况
type vehicleMaintainChargeStatus int

var VehicleMaintainChargeStatus vehicleMaintainChargeStatus

// 无需收费
func (c *vehicleMaintainChargeStatus) NoNeedCharge() int {
	return 1
}

// 已收费
func (c *vehicleMaintainChargeStatus) Charged() int {
	return 2
}

// 现场收费
func (c *vehicleMaintainChargeStatus) ChargeOnSite() int {
	return 3
}

// 待收费
func (c *vehicleMaintainChargeStatus) ToBeCharged() int {
	return 4
}

func (c *vehicleMaintainChargeStatus) ToText(value int) string {
	switch value {

	case 1:
		return "无需收费"

	case 2:
		return "已收费"

	case 3:
		return "现场收费"

	case 4:
		return "待收费"

	}
	return ""
}

func (c *vehicleMaintainChargeStatus) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *vehicleMaintainChargeStatus) ToValue(text string) int {
	switch text {

	case "无需收费":
		return 1

	case "已收费":
		return 2

	case "现场收费":
		return 3

	case "待收费":
		return 4

	}
	return 0
}
